#define _CRT_SECURE_NO_WARNINGS 1

void rotate(int* nums, int numsSize, int k) {
    int numss[numsSize];
    k = k % numsSize;
    int i = 0;
    for (; i < k; i++)
    {
        numss[i] = nums[numsSize - k + i];
    }
    for (; i < numsSize; i++)
    {
        numss[i] = nums[i - k];
    }
    for (int j = 0; j < numsSize; j++)
    {
        nums[j] = numss[j];
    }
}